const express = require("express");
const exApp = express();
module.exports = exApp;
const cors = require("cors");

var bodyParser = require("body-parser");
// const formidable = require("express-formidable");
// exApp.use(formidable());
exApp.use(express.json());
exApp.use(express.urlencoded({ extended: false })); // 表单请求
exApp.use(bodyParser.json({ limit: "5000mb" }));
exApp.use(bodyParser.urlencoded({ limit: "5000mb", extended: true }));
exApp.use(cors()); // 跨域

exApp.use(express.static("public"));
exApp.use("/uploads", express.static(__dirname + "/uploads"));

require("./routes/user.js");
require("./routes/lxf.js");
require("./routes/food.js");
require("./socket/socket");
// require("./routes/index.js");
// require("./socket/socket");
// require("./routes/memberList");
// require("./routes/mine");
// require("./routes/img.js");
// require("./routes/code.js");
// require("./routes/release.js");
require('./routes/home.js')

exApp.use(express.static("public"));

exApp.use("/uploads", express.static(__dirname + "/uploads"));
exApp.listen(8888, () => console.log(`启动成功:http://localhost:8888/`));
